package com.example.demo.service.Impl;

import com.example.demo.entity.Student;
import com.example.demo.map.StudentMapper;
import com.example.demo.service.StudentService;
import com.example.demo.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;


public class StudentServiceImpl implements StudentService {
    @Override
    public Student queryById(int id) {
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        StudentMapper mapper = sqlSession.getMapper(StudentMapper.class);
        Student student = mapper.queryStudentById(id);
        sqlSession.close();
        return student;
    }
}
